home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Applications
/
Utilities
/
BackSpace
/
Source
/
Thinker.h
< prev
next >
Wrap
Text File
|
1993-07-14
|
4KB
|
213 lines
#import <appkit/Application.h>
#import <appkit/View.h>
#import <dpsclient/dpsNeXT.h>
#include <sys/resource.h>
#import <drivers/event_status_driver.h>
#import "ModuleList.h"
#define NOWINDOW (0)
#define NORMALWINDOW (1)
#define BACKWINDOW (2)
// sleeptier can't be higher than menus, unfortunately
#define SAVERTIER (50)
#define SLEEPTIER (18)
#define BACKGROUNDTIER (-100)
// I'm not at all happy with BackSpace's time handling; it only works
// for 49 days after rebooting (according to my calculations... I boot
// a lot more often than that!) since it counds milliseconds in a
// 32 bit unsigned int. This problem would be solved if I stuffed the
// time in a long long, but I think the compiler doesn't correctly do
// 64 bit comparisons. Time should probably stay in the unix
// timeval struct. Yuck! guess I should write functions for time
// addition and comparison...
// typedef long long BStimeval; //doesn't work
typedef unsigned BStimeval;
// a function to return BackSpace's Thinker instance or it's equivalent
id BSThinker();
enum BSEvents {BSDOSAVER, BSOPENFILE};
BStimeval currentTimeInMs();
float frandom();
float randBetween(float a, float b);
@interface Thinker:Object
{
id spaceView;
id spaceWindow;
id normalWindow;
id bigUnbufferedWindow;
id bigBufferedWindow;
BOOL timerValid, keepLooping;
BOOL doingSaver;
DPSTimedEntry timer;
int windowType;
int realViewIndex;
int virtualViewIndex;
NXRect windowRect;
NXZone *backZone;
int screenCount;
id windMatrix;
id screenSaver;
id screenLocker;
BOOL screenSaverVal;
id mySlider;
id priorityLevel;
int priority;
NXEventHandle evs; //event driver file descriptor
double dimBrightness, normalBrightness;
id viewSelectionBrowser;
ModuleList *moduleList;
id imageView;
NXScreen *screens;
id screenList;
id image;
int globalTier;
id password;
id invisibleInspectorBox;
id commonImageInspector;
id nullInspector;
id spaceInspector;
id boinkInspector;
id currentInspector;
NXRect inspectorFrame;
id oldInspectorOwner;
BOOL browserValid;
id infoPanel;
char *fileToOpen;
BOOL openAnother;
int windowHasBeenDisplayed;
id sleepWindow;
id cornerView;
}
- appDidInit:sender;
- appDidHide:sender;
- appDidUnhide:sender;
- createTimer;
- removeTimer;
- doDistributorLoop;
- installSpaceViewIntoWindow:w;
- useNormalWindow;
- (int) backingTypeForView:aView;
- useBackWindow:(int)tier;
- createBigWindowIfNecessaryForView:aView;
- getWindowType;
- changeWindowType:sender;
- changeWindowTypeAndRemember:(BOOL)rem;
- getScreenSaverSetting;
- changeScreenSaverSetting:sender;
- setScreenSaver:(BOOL)val andRemember:(BOOL)rem;
- calcDimTime;
- maybeDoScreenSaver:sender;
- applicationDefined:(NXEvent *)theEvent;
- showFakeScreenSaverAfterPause:sender;
- showFakeScreenSaver:sender;
- doScreenSaver:sender;
- getPrioritySetting;
- changeSliderValue:sender;
- saveSliderValue;
- setImageFromFile: (const char *) filename;
- setImageFromName: (const char *) name;
- commonImageInit;
- getImageFile;
- setImageFileFrom: sender;
@end
@interface Thinker(thinkMore)
- getViewType;
- selectRealViewIndex:sender;
- setVirtualViewIndexAndIncrement:(BOOL)flag;
- selectScreenSaverViews;
- setWindowTitle;
- getScreenLockerSetting;
- changeScreenLockerSetting:sender;
- setScreenLocker:(BOOL)val andRemember:(BOOL)rem;
- backView;
- showInfoPanel:sender;
- createSleepWindow;
- setSleepCorner:(int)val;
- getHotCornerSetting;
@end
@interface Thinker(ioctls)
- normalMode;
- screenSaverMode;
- blackOutAllScreens;
- unBlackOutAllScreens;
- getDimBrightness:(double *)b;
- _setDimBrightness :(double *)b;
- getNormalBrightness :(double *)b;
- getDimTime :(double *)t;
@end
@interface Thinker(inspector)
- commonImageInspector;
- nullInspector;
- spaceInspector;
- boinkInspector;
- revertToDefaultImage:sender;
- (BOOL)browser:sender columnIsValid:(int)column;
- addCellWithString:(const char *)str at:(int)row toMatrix:matrix;
- (int)browser:sender fillMatrix:matrix inColumn:(int)column;
- loadViewsFrom: (const char *) dirname;
- doDelayedOpenFile;
- (const char *) appDirectory;
- (const char *) moduleDirectory:(const char *)name;
- (struct mach_header *) headerForModule:(const char *)name;
@end
@interface View(someOptionalMethods)
- newWindow;
- enteredScreenSaverMode;
- willExitScreenSaverMode;
@end